<?php

namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Auth;

class WatchLog extends Model
{
    protected $fillable=['messageid','messageaccountid'];
    protected $table='watch_log';

    public function watchEmail($messageid)
    {
        $email = Auth::user()->email;
        $accountid = Account::where('accountaddress',$email)->pluck('accountid');
        $this->messageid = $messageid;
        $this->messageaccountid = $accountid;
        $this->save();
    }
}
